<script>
	export default {
		onLaunch: function() {
			//检查语言类型
			let lan = uni.getStorageSync("langSetting")
			let wxInfo = uni.getStorageSync("wxInfo") || {}
			let userInfo = uni.getStorageSync("userInfo") || {}
			if(lan == 'zh') {
				 this.$i18n.locale = 'zh-CN'
				 uni.setStorageSync('langSetting', 'zh')
			}else if (lan == 'en') {
                 this.$i18n.locale = 'en-US'
				 uni.setStorageSync('langSetting', 'en')
			} else if (wxInfo || userInfo){
				if (wxInfo.language == 'zh-CN') {
					this.$i18n.locale = wxInfo.language
					uni.setStorageSync('langSetting', 'zh')
				} else {
					this.$i18n.locale = 'en-US'
					uni.setStorageSync('langSetting', 'en')
				}
			} else {
				this.$i18n.locale = 'zh-CN'
				uni.setStorageSync('langSetting', 'zh')
			}
		},
		onShow: function() {
			// console.log('App Show')
		},
		onHide: function() {
			// console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
</style>
